-
-
Notifications
You must be signed in to change notification settings - Fork 145
feat(series): #1098 arithmetic addition #1275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(series): #1098 arithmetic addition #1275
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like great progress here!
3b3f899
to
bf79de1
Compare
02c646d
to
8f43efc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @cmp0xff!
I approved but I will let @Dr-Irv review/merge when he is back as this is a larger MR. I think adding all these overloads is in the the spirit of what pandas-stubs has been doing (but it might also create more maintenance burden).
(Personally, I'm still hoping for something like this #820 (comment) which would be more generic, but not supported by today's type checkers/python type system)
e101ff4
to
14f79a0
Compare
14f79a0
to
2b94ab0
Compare
This PR is motivated by #1273 (review).
Comprehensive plan (maybe in another PR)
Inspired by #1093, one can draft the following comprehensive plan for all possible combinations of the left arithmetic operand, the binary arithmetic operator and the right arithmetic operand.
Left operand
Series[Any]
Series[int]
Series[float]
Series[complex]
Binary arithmetic operators
Include their right-version and functional version. In
add
we give a full example. We follow the official documentation.__add__
,__radd__
,add
,radd
__truediv__
__floordiv__
__pow__
__mod__
__mul__
__sub__
Right operand
Scalar
Sequence
numpy
arraysSeries
Draft of a plan
add
.Checklist
assert_type()
to assert the type of any return value